<?php
if ((!$forceAdEnabled && !jfJQMAmobeeAds::isEnabled()) || !$adspace) {
	return;
}

$adspace = (array)$sf_data->getRaw('adspace');
$adspaceFallback = $sf_data->offsetExists('adspaceFallback') ? (array)$sf_data->getRaw('adspaceFallback') : null;
$adspaceId = join('-', (array)$adspace);
$tag = isset($tag) ? $tag : 'div';
$jsConfig = $sf_data->offsetExists('jsConfig') ? $sf_data->getRaw('jsConfig') : array();
$jsConfig = array_merge(array(
	'id' => $adspaceId,
	'adspaces' => $adspace,
	'adspacesFallback' => $adspaceFallback,
	'priority' => 1,
), $jsConfig);

$cssClasses = $sf_data->offsetExists('cssClasses') ? $sf_data->getRaw('cssClasses') : array();
$cssClasses = array_merge(array('jfJQMAmobeeAd', 'hidden'), $cssClasses);
?>
<<?php echo $tag ?> class="<?php echo htmlspecialchars(implode(' ', $cssClasses)) ?>" data-jfJQMAmobeeAds-adspace="<?php echo $adspaceId ?>" data-jfJQMAmobeeAds-config='<?php echo json_encode($jsConfig) ?>'></<?php echo $tag ?>>